<template>
    <div class="profile">
      <h2>我的页面</h2>
      <p>本项目只实现了聊天界面的框架，请勿将其用于违法用途。</p>
      <a-button type="primary" @click="toggleEditMode">
        {{ isEditMode ? '预览' : '编辑' }}
      </a-button>
    </div>
  </template>
  
  <script>
  import { computed } from 'vue';
  import { useStore } from 'vuex';
  
  export default {
    setup() {
      const store = useStore();
      const isEditMode = computed(() => store.state.isEditMode);
  
      const toggleEditMode = () => {
        store.commit('toggleEditMode');
      };
  
      return {
        isEditMode,
        toggleEditMode,
      };
    },
  };
  </script>
  
  <style scoped>
  .profile {
    padding: 20px;
    text-align: center;
  }
  </style>